/*
 *  Copyright 2007-2008 by Matthias Buch-Kromann <mbk.isv@cbs.dk>.
 *  *
 *  This file is part of the Open-source Dependency Toolkit (OSDT),
 *  see http://code.google.com/p/open-source-dependency-toolkit.
 *  
 *  The OSDT is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as 
 *  published by the Free Software Foundation, either version 3 of 
 *  the License, or (at your option) any later version.
 * 
 *  The OSDT is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 * 
 *  You should have received a copy of the GNU Lesser General Public 
 *  License along with the OSDT in the files COPYING and COPYING.LESSER.
 *  If not, see http://www.gnu.org/licenses.
 */

package org.osdtsystem.operations.factories;

import org.osdtsystem.graphs.Graph;
import org.osdtsystem.values.Location;
import org.osdtsystem.operations.Operation;
import org.osdtsystem.operations.OperationType;
import java.util.EnumSet;
import java.util.Iterator;

/**
 * Public interface for classes that generate elementary operations. At 
 * initialization, the operation factory should be given information such as
 * the list of linguistic structures that it generates operations for, and the
 * set of elementary operation types that it is allowed to use. 
 * @author Matthias Buch-Kromann <mbk.isv@cbs.dk>
 */
public interface OperationFactory {
    /**
     * Return an iterator that generates operations at the given location in 
     * the given graph. For efficiency reasons, the iterator should generate 
     * the operations in a heuristic best-first order so that operations with 
     * a higher chance of success tend to be generated before operations
     * with a lower chance of success. 
     * @param graph the graph 
     * @param location the location in the graph
     * @return an iterator that can generate the elementary operations 
     */
    public Iterator<Operation>
            getOperations(Graph graph, Location location);
    
    /**
     * Returns the set of types of elementary operations that can be contained
     * in operations generated by the operation factory. 
     * @return the set of elementary operation types
     */
    public EnumSet<OperationType> getOperationTypes();
}
